library(ggplot2)
library(dplyr)


survey_long <- readRDS("data/df_long.rds")


############ Figure 2: Distance-Feeling Plots

base <- ggplot(survey_long %>% filter(close_relationship != "" & d_ownparty == 0) %>% 
         group_by(close_relationship2) %>%
         summarise(feeling_toward = weighted.mean(feeling_toward, weights = meta_Weight))) + 
  geom_bar(aes(feeling_toward, y = as.factor(close_relationship2)), 
           position = "dodge", stat = "identity") +
  ylab("") +
  xlim(c(0,7)) +
  xlab("Average feeling thermometer value") +
  theme_bw() + 
  theme(text= element_text(size = 16))
ggsave("figures/Figure2.jpeg", height = 6, width = 8, dpi = 600)